package com.aaa.controller;

import com.aaa.entity.Student;
import com.aaa.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private StudentService studentService;

    @RequestMapping("/listAll")
    public List<Student> listAll(){
        List<Student> list = studentService.list();
        return list;
    }

    @RequestMapping("/save")
    public boolean save( Student student){
        boolean save = studentService.save(student);
        return save;
    }
}
